import { _decorator, Component, Label, assetManager, director, game } from "cc";
import { Login } from "../../_RealName/Login";

const { ccclass, property } = _decorator;

@ccclass
export default class JKZGUI extends Component {

    isLoad = false;
    isMusic = false
    isShow = false;

    onLoad() {
        game.frameRate = 59;
        assetManager.loadBundle("models", () => {
            this.isLoad = true;
            this.Check();
        });

        assetManager.loadBundle("music", () => {
            this.isMusic = true;
            this.Check();
        });

        this.scheduleOnce(() => {
            this.isShow = true;
            this.Check();
        }, 2);
    }

    Check() {
        // if (this.isLoad && this.isMusic && this.isShow) director.loadScene("MainScene");

        if (this.isLoad && this.isShow) Login.Instance.init();
    }
}
